﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IHISCETeim.DAL;
using IHISCETeim.Model;
using IHISCETeim.Library;
using System.Data;

namespace IHISCETeim.BLL
{
    public  class WOWORTaskController
    {
        /// <summary>
        /// 获取可使用的未清生产订单
        /// </summary>
        /// <param name="ItemCode"></param>
        /// <returns></returns>
        public static DataTable GetTask(string ItemCode)
        {
            return WOWORTaskDAL.GetTask(ItemCode);
        }
         /// <summary>
        /// 添加生产任务
        ///处理方法:
        ///将不同生产订单相同物料号的合并起来,不区分工位
        /// </summary>       
        /// <returns></returns>
        public static int AddWoroTask(string RealName, string Pname, string docnums, string SendQtys)
        {
            return WOWORTaskDAL.AddWoroTask(RealName, Pname, docnums, SendQtys);
        }
         /// <summary>
        /// 检测生产作业项目是否发布过
        /// </summary>
        /// <param name="Pname"></param>
        /// <returns></returns>
        public static int CheckOWORTaskByPName(string Pname)
        {
            return WOWORTaskDAL.CheckOWORTaskByPName(Pname);
        }

        /// <summary>
        /// 获取发料列表
        /// </summary>
        /// <param name="SQLWHERE"></param>
        /// <returns></returns>
        public static DataTable GetNeedSendItm(string SQLWHERE)
        {
            return WOWORTaskDAL.GetNeedSendItm(SQLWHERE);
        }


        /// <summary>
        /// 发料操作
        /// </summary>
        /// <param name="IDs"></param>
        /// <param name="NowSendQtys"></param>
        /// <returns></returns>
        public static int SendPrdctShip(string IDs, string NowSendQtys, string OperateUser)
        {
            return WOWORTaskDAL.SendPrdctShip(IDs, NowSendQtys, OperateUser);
        }

        /// <summary>
        /// 获取需要发料的项目,项目需为未完成
        /// </summary>
        /// <param name="IDs"></param>
        /// <param name="NowSendQtys"></param>
        /// <returns></returns>
        public static DataTable GetNeedSendProject()
        {
            return WOWORTaskDAL.GetNeedSendProject();
        }
    }
}
